Skip to content

Conversation

@shethaadit
Copy link
Contributor

@shethaadit shethaadit commented Dec 18, 2024

Summary

This PR updates the example in the Implicit Index Access section of the C# 13 documentation to include the missing definition of the TimerRemaining class. The current example assumes the existence of a buffer array but does not clarify its source, which may lead to confusion.

Changes Made:
Added the TimerRemaining class definition, including the buffer property initialized with a length of 10.
Updated the accompanying text to clarify that the TimerRemaining class includes the buffer array and how the "from the end" index operator (^) is applied to assign values to it.

These changes ensure the example is self-contained and easier for readers to understand.

Fixes #44001


Internal previews

📄 File 🔗 Preview link
docs/csharp/whats-new/csharp-13.md What's new in C# 13

@shethaadit shethaadit requested review from a team and BillWagner as code owners December 18, 2024 16:07
@dotnetrepoman dotnetrepoman bot added this to the December 2024 milestone Dec 18, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Dec 18, 2024
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @shethaadit

I'll :shipit: now.

@BillWagner BillWagner enabled auto-merge (squash) December 19, 2024 14:33
@BillWagner BillWagner merged commit 2d21c75 into dotnet:main Dec 19, 2024
13 checks passed
```csharp
public class TimerRemaining
{
public int[] buffer { get; set; } = new int[10];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the setter could be left out which would emphase the buffer = below isn't doing a set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc whats-new/subsvc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C# 13 Implicit index access example

4 participants